﻿using System;
using System.Linq;
using System.Text;
using DevExpress.Xpo;
using DevExpress.ExpressApp;
using System.ComponentModel;
using DevExpress.ExpressApp.DC;
using DevExpress.Data.Filtering;
using DevExpress.Persistent.Base;
using System.Collections.Generic;
using DevExpress.ExpressApp.Model;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;
using DevExpress.Persistent.BaseImpl.PermissionPolicy;

namespace Tida.Module.BusinessObjects.系统管理
{

    [ImageName("BO_Role")]
    [NavigationItem("系统管理")]
    [XafDisplayName("角色")]
    public class Sys_Role : PermissionPolicyRoleBase, IPermissionPolicyRoleWithUsers
    {
        public Sys_Role(Session session)
            : base(session)
        {
        }
        [Association("Sys_Users-Sys_Roles")]
        public XPCollection<Sys_User> Sys_Users
        {
            get
            {
                return GetCollection<Sys_User>("Sys_Users");
            }
        }
        IEnumerable<IPermissionPolicyUser> IPermissionPolicyRoleWithUsers.Users
        {
            get { return Sys_Users.OfType<IPermissionPolicyUser>(); }
        }
    }

}